﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace SharingCenter.Web.Shared
{
    public partial class SiteHeader : System.Web.UI.UserControl
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated && WebProfile.Current.UserId == Guid.Empty)
            {
                FormsAuthentication.RedirectToLoginPage();
            }
        }

        protected void LoginStatus1_Init(object sender, EventArgs e)
        {
            LoginStatus s = (LoginStatus)sender;
            s.LoggedOut += new EventHandler(s_LoggedOut);
        }

        void s_LoggedOut(object sender, EventArgs e)
        {
            Response.Redirect("~/");
        }
    }
}